<?php
if(!isset($_SESSION)) 
{ 
session_start(); 
} 
include '../../connection/connection.php';
include "../../value/value_kr.php";

$idconfigcamer = $_REQUEST['idconfigcamera'];

$selectConfcamera = mysql_query("select cf.* from configcamera cf where cf.id = $idconfigcamer", $connection);
$rowconf = mysql_fetch_assoc($selectConfcamera);

$selectDVR = mysql_query("select * from dvr", $connection);

?>
<table  cellpadding="0" cellspacing="0" border="0" width="100%" class="tbm1">
		<tr>
	    		<td>ID :</td>
	    		<td> <input type="text" id="txtcamera" name="txtcamera" value="<?=$rowconf[id]?>" style="width: 95px;background: #A7A7A7;border: 1px #A7A7A7;padding-left: 5px;line-height: 26px;" readonly="readonly"  ></td>
	    		<td><?php echo $l_name?> :</td> 
	    		<td><input type="text" id="txtnamecamera" name="txtnamecamera" style="width: 200px;padding-left: 5px;line-height: 26px;"  value="<?=$rowconf[name]?>" ></td>
	    		<td><?php echo $l_server?>: </td> 
	    		<td><input type="text" id="txtserver" name="txtserver" style="width: 300px;padding-left: 5px;line-height: 26px;" value="<?=$rowconf[host]?>"> </td>
	    		<td>pos_x: </td> 
	    		<td><input type="text" id="txtposx" name="txtposx"  style="width: 150px;padding-left: 5px;line-height: 26px;" value="<?=$rowconf[pos_x]?>"></td>
	    		<td>pos_y: </td> 
	    		<td><input type="text" id="txtposy" name="txtposy"  style="width: 150px;padding-left: 5px;line-height: 26px;" value="<?=$rowconf[pos_y]?>"></td>
	    	</tr>
	    	
	    	<tr>
	    		<td>DVR :</td>
	    		<td> <select size="1" name="txtDVR" id="txtDVR" style="width: 95px;height: 26px;padding-top:3px;padding-left: 5px;">
	    			<?php if ($rowconf[DVR]==0){?>
	    				<option></option>
	    				<?php while ($rowdvr = mysql_fetch_array($selectDVR)){?>
	    				<option style="padding: 5px;" value="<?=$rowdvr[id]?>" id="<?=$rowdvr[id]?>" <? if ($rowconf[DVR]==$rowdvr[id]){?> selected="selected" <?php }?>><?=$rowdvr[name]?></option>
	    			<?php }?>
	    			<?php }else{?>
	    			
	    			<?php while ($rowdvr = mysql_fetch_array($selectDVR)){?>
	    				<option style="padding: 5px;" value="<?=$rowdvr[id]?>" id="<?=$rowdvr[id]?>" <? if ($rowconf[DVR]==$rowdvr[id]){?> selected="selected" <?php }?>><?=$rowdvr[name]?></option>
	    			<?php }?>
	    			<?php }?>
	    			</select>
	    		</td>
	    		<td>IP :</td>  
	    		<td><input type="text" id="txtIPconf" name="txtIPconf" style="width: 200px;padding-left: 5px;line-height: 26px;"  value="<?=$rowconf[IP]?>"></td>
	    		<td>Port: </td> 
	    		<td><input type="text" id="txtPort" name="txtPort"  value="<?=$rowconf[Port]?>" style="padding-left: 5px;line-height: 26px;"> &nbsp;&nbsp;&nbsp;&nbsp;
	    			<?php echo $l_mode?>:&nbsp;
	    			<select size="1" name="mode" id="mode" style="width: 85px;height: 26px;padding-top:3px;">
		    			<option style="padding: 5px;" value="<?=$rowconf[go_mode]?>" id="<?=$rowconf[go_mode]?>" <? if ($rowconf[go_mode]==0){?> selected="selected" <?}?>><?php echo $l_go?></option>
		    			<option style="padding: 5px;" value="<?=$rowconf[go_mode]?>" id="<?=$rowconf[go_mode]?>" <? if ($rowconf[go_mode]==1){?> selected="selected" <?}?>><?php echo $l_come?></option> 
	    			</select> 
	    		</td>
	    		<td>UserID: </td> 
	    		<td><input type="text" id="txtUserID" name="txtUserID"  value="<?=$rowconf[UserID]?>"  style="width: 150px;padding-left: 5px;line-height: 26px;"></td>
	    		<td>PW: </td> 
	    		<td><input type="password" id="txtPW" name="txtPW"  value="<?=$rowconf[PW]?>"  style="width: 150px;padding-left: 5px;line-height: 26px;"></td>
	    	</tr>
	    	<tr>
	    		<td colspan="12" style="right: 50px">
		    		 <div style="height: 10px;clear: both;"></div>
				     <div style="right: 50px;display: inline-block;top: 10px;float: right;">
				   		 <input type="button" class="inbtn" style="width: 65px;" value="<?=$l_new?>" id="buttonadd" name="buttonadd" onclick="onclickAddCamera();"> 
				    	<input type="button"   class="inbtnDisable" style="width: 65px;"  value="<?php echo $l_edit?>"  id="buttonedit" name="buttonedit"  disabled="disabled"  onclick="edit_configCamera();">
				    	<input type="button" class="inbtnDisable" style="width: 65px;"  value="<?php echo $l_delete?>" id="buttondelete" name="buttondelete" disabled="disabled" onclick="if(confirm('<?=$l_areyousure?>')){ delete_configCamera();return true;}else{return false;}">
				    	<input type="button" class="inbtn" style="width: 65px;" value="<?php echo $l_reset?>" onclick="resetConfigCamera();">
			  		  </div>
	    		</td>
	    	</tr>
	    	</table>
	    	  <?php mysql_close($connection);?>